package com.example.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.dto.SpuDto;
import com.example.entity.SSpu;
import com.example.mapper.SSkuMapper;
import com.example.mapper.SSpuMapper;
import com.example.service.SSpuService;
import com.example.vo.SSpuVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 鞋子商品表(spu)，例如特步老人鞋 服务实现类
 * </p>
 *
 * @author zh
 * @since 2024-05-13 10:36:20
 */
@Service
public class SSpuServiceImpl extends ServiceImpl<SSpuMapper, SSpu> implements SSpuService {
    @Autowired
    private SSpuMapper spuMapper;
    @Autowired
    private SSkuMapper sskuMapper;

    public IPage<SSpuVO> findPage(Page<SSpuVO> page,SpuDto spuDto) {
        return spuMapper.findPage(page,spuDto);
    }


    public IPage<SSpuVO> findPageBySalesAsc(Page<SSpuVO> page, SpuDto spuDto) {
        return spuMapper.findPageBySalesAsc(page,spuDto);
    }


    public IPage<SSpuVO> findPageBySalesDesc(Page<SSpuVO> page, SpuDto spuDto) {
        return spuMapper.findPageBySalesDesc(page,spuDto);
    }


    public IPage<SSpuVO> findPageByPriceAsc(Page<SSpuVO> page, SpuDto spuDto) {
        return spuMapper.findPageByPriceAsc(page,spuDto);
    }


    public IPage<SSpuVO> findPageByPriceDesc(Page<SSpuVO> page, SpuDto spuDto) {
        return spuMapper.findPageByPriceDesc(page,spuDto);
    }


    public IPage<SSpuVO> frontfindPage(Page<SSpuVO> page, SpuDto spuDto) {
        return spuMapper.frontfindPage(page,spuDto);
    }


    public IPage<SSpuVO> frontfindPageBySalesAsc(Page<SSpuVO> page, SpuDto spuDto) {
        return spuMapper.frontfindPageBySalesAsc(page,spuDto);
    }


    public IPage<SSpuVO> frontfindPageBySalesDesc(Page<SSpuVO> page, SpuDto spuDto) {
        return spuMapper.frontfindPageBySalesDesc(page,spuDto);
    }


    public IPage<SSpuVO> frontfindPageByPriceAsc(Page<SSpuVO> page, SpuDto spuDto) {
        return spuMapper.frontfindPageByPriceAsc(page,spuDto);
    }


    public IPage<SSpuVO> frontfindPageByPriceDesc(Page<SSpuVO> page, SpuDto spuDto) {
        return spuMapper.frontfindPageByPriceDesc(page,spuDto);
    }

    public List<SSpuVO> sales() {
        return spuMapper.sales();
    }

    public List<SSpuVO> recommend() {
        return spuMapper.getRecommend();
    }

    public SSpuVO getOneSpuVO(Long id){return  spuMapper.getOneSpuVO(id);}


}

